package com.example.pc.listview05;

import android.app.Activity;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.RequiresApi;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.support.v4.app.*;

import static android.R.attr.fragment;

/**
 * Created by PC on 2017/9/15.
 */

public class SecondActivity extends Activity  {
         @RequiresApi(api = Build.VERSION_CODES.HONEYCOMB)
         public void onCreate (Bundle saveInstanceState) {
             super.onCreate(saveInstanceState);
             setContentView(R.layout.secondactivity);
             Intent intent = this.getIntent();//获取上个活动的itent
             Bundle bundle = intent.getExtras();//获取上个活动的bundle
             String str = bundle.getString("key");//赋值给str
             TextView textView = (TextView) findViewById(R.id.textview2);
             textView.setText(str);

             Button button = (Button)findViewById(R.id.second_button);
             button.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View v) {
                     Intent intent = new Intent(SecondActivity.this,ThirdActivity.class);
                     startActivity(intent);
                 }
             });

         }


}

